<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title>对账</title>
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="../../../component/elementUI/index.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css" />
  <link rel="stylesheet" href="../../../style/index.css" />
  <style>
    .el-input.is-disabled .el-input__inner {
      color: #000;
      background-color: #fff;
    }

    /* .el-input__inner {
        height: 32px;
        line-height: 32px;
      } */
  </style>
</head>

<body>
  <div id="app" v-cloak>
    <yl-page-header content="与甲方对账"></yl-page-header>
    <el-form ref="contract" :rules="rules" inline-message="true" :model="form" style="width: 100%">
      <div class="table_titel">
        <div class="titel">对账主体</div>
      </div>
      <el-descriptions :column="4" border size="small">
        <el-descriptions-item label="甲方企业*">
          <el-form-item prop="Department_SerialNumber">
            <el-select v-model="form.Department_SerialNumber" clearable placeholder="请选择" style="width: 100%"
              @change="JFhandleChange">
              <el-option v-for="item in department" :key="item.Department_SerialNumber" :label="item.Department_Name"
                :value="item.Department_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <!-- <el-descriptions-item label="甲方企业">
            <el-form-item prop="Department_SerialNumber">
              <el-select
                v-model.trim="form.Department_SerialNumber"
                multiple
                collapse-tags
                clearable
                style="width: 100%"
                placeholder="请选择甲方企业"
              >
                <el-option
                  v-for="item in department"
                  :key="item.Department_SerialNumber"
                  :label="item.Department_Name"
                  :value="item.Department_SerialNumber"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-descriptions-item> -->
        <el-descriptions-item label="活动名称">
          <el-form-item prop="Activity_SerialNumber">
            <el-select clearable  @change="handleChange" v-model="Activity_SerialNumber" placeholder="请选择活动名称" style="width: 100%">
              <el-option v-for="item in iJSONArray_hdmc" :key="item.Activity_SerialNumber" :label="item.Activity_Name"
                :value="item.Activity_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="商品名称">
          <el-form-item prop="Article_SerialNumber">
            <el-select clearable  v-model="Article_SerialNumber" filterable placeholder="请选择商品名称" style="width: 100%">
              <el-option v-for="item in iJSONArray_article_info" :key="item.Article_SerialNumber"
                :label="item.Article_Name" :value="item.Article_SerialNumber">
              </el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="时间范围*">
          <el-form-item>
            <el-date-picker clearable  style="width: 100%; border: 0" v-model="form.Sales_Date" type="daterange"
              range-separator="至" start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
              end-placeholder="结束日期">
            </el-date-picker>
            <!-- <el-date-picker
                prefix-icon="el-icon-date"
                v-model="form.Sales_Date"
                clearable
                type="datetimerange"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              ></el-date-picker> -->
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="下单人">
          <el-form-item prop="Open_ID">
            <el-select clearable  v-model="Open_ID" placeholder="请选择下单人" style="width: 100%">
              <el-option v-for="item in iJSONArray_member_info" :key="item.Open_ID" :label="item.Member_Name"
                :value="item.Open_ID"></el-option>
            </el-select>
          </el-form-item>
          <!-- <el-form-item prop="xdr">
              <el-input
                v-model.trim="form.xdr"
                clearable
                placeholder="请输入下单人"
              />
            </el-form-item> -->
        </el-descriptions-item>
        <el-descriptions-item label="下单人手机号">
          <el-form-item prop="phone">
            <el-input v-model.trim="form.phone" clearable placeholder="请输入下单人手机号" />
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="订单编号/订单明细编号">
          <el-form-item prop="Sales_Order_SerialNumber">
            <el-input v-model.trim="form.Sales_Order_SerialNumber" clearable placeholder="订单编号/订单明细编号" />
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="订单状态">
          <el-form-item prop="value">
            <el-select clearable  v-model="value" placeholder="请选择订单状态" style="width: 100%">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <div class="table_titel">
        <div class="titel">对账明细</div>
        <div class="operation">
          <el-button type="primary" @click="onSerach('contract')">查询</el-button>
        </div>
      </div>
      <el-table v-if="table" :row-key="row=>row.index" :data="tableData" stripe border height="600" style="width: 100%"
        @selection-change="handleSelectionChange">
        <el-table-column  fixed="left" align="center" type="selection" :reserve-selection="true" width="45"></el-table-column>
        <el-table-column  fixed="left" align="center" type="index" label="序号" width="50"></el-table-column>
        <!-- <el-table-column
            align="center"
            prop="Sales_Order_Detail_SerialNumber"
            width="300"
            show-overflow-tooltip
            label="订单明细编号"
          ></el-table-column> -->
        <el-table-column  fixed="left" align="center" prop="Sales_Order_SerialNumber" width="300" show-overflow-tooltip
          label="订单编号"></el-table-column>
        <el-table-column  fixed="left" align="center" prop="Activity_Name" width="300" show-overflow-tooltip
          label="活动名称"></el-table-column>
        <el-table-column align="center" prop="Collection_Date" width="300" show-overflow-tooltip
          label="日期"></el-table-column>
        <el-table-column align="center" prop="Member_Nike" width="300" show-overflow-tooltip
          label="下单人"></el-table-column>
        <el-table-column align="center" prop="Sales_Address" width="300" show-overflow-tooltip
          label="下单地址"></el-table-column>
        <el-table-column align="center" prop="Sales_Phone" width="300" show-overflow-tooltip
          label="下单手机号"></el-table-column>
        <el-table-column align="center" prop="Row_Status" width="300" show-overflow-tooltip
          label="订单状态">
          <template v-slot="{row}">
            {{row.Row_Status=='0'?'未发货':row.Row_Status=='1'?'部分发货':row.Row_Status=='2'?'已发货':row.Row_Status=='3'?'已对账':''}}
          </template>
        </el-table-column>
        <el-table-column align="center" prop="Supplier_Name" width="300" show-overflow-tooltip
          label="供应商"></el-table-column>
        <el-table-column align="center" prop="Article_Name" width="300" show-overflow-tooltip
          label="商品名称"></el-table-column>
        <el-table-column align="center" prop="Quantity" width="300" show-overflow-tooltip label="数量"></el-table-column>
        <el-table-column align="center" prop="Amount" width="300" show-overflow-tooltip label="订单金额"></el-table-column>
        <!-- <el-table-column
            align="center"
            prop="Amount"
            width="300"
            show-overflow-tooltip
            label="联系人"
          ></el-table-column> -->
        <el-table-column align="center" prop="Sales_Point" width="300" show-overflow-tooltip
          label="应结金额"></el-table-column>
        <!-- <el-table-column
            align="center"
            prop="Department_Name"
            width="300"
            show-overflow-tooltip
            label="部门名称"
          >
            <template v-slot="{row}">
              <el-select
                v-model="row.Department_SerialNumber"
                placeholder="请选择部门名称"
              >
                <el-option
                  v-for="item in row.Department"
                  :key="item.Department_SerialNumber"
                  :label="item.Department_Name"
                  :value="item.Department_SerialNumber"
                >
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="Supplier_Name"
            width="150"
            show-overflow-tooltip
            label="供应商"
          ></el-table-column> -->
        <!-- <el-table-column
            align="center"
            prop="Article_Name"
            width="150"
            show-overflow-tooltip
            label="商品名称"
          ></el-table-column> -->
        <!-- <el-table-column
            align="center"
            prop="Specifications_Name"
            width="150"
            show-overflow-tooltip
            label="规格名称"
          ></el-table-column> -->
        <!-- <el-table-column
            align="center"
            prop="Sales_Date"
            width="180"
            label="下单时间"
          ></el-table-column> -->
        <!-- <el-table-column
            align="center"
            prop="Collection_Date"
            width="180"
            label="付款时间"
          >
            <template v-slot="{row}">
              <span>{{getYMDHMSDate(row.Collection_Date)}}</span>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="Sales_Unit_Price"
            width="100"
            label="销售单价"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="Purchase_Unit_Price"
            width="100"
            label="采购单价"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="Delivery_Quantity"
            width="100"
            label="发货数量"
          ></el-table-column>
          <el-table-column align="center" width="100" label="采购总价">
            <template v-slot="{row}">
              <span
                >{{accMul(row.Delivery_Quantity,
                row.Purchase_Unit_Price)}}</span
              >
            </template>
          </el-table-column>
          <el-table-column align="center" prop="Row_Status" label="发货状态">
            <template v-slot="{row}">
              <el-tag
                :type="row.Row_Status=='0'?'':row.Row_Status=='1'?'warning':'success'"
                >{{Type(row.Row_Status)}}</el-tag
              >
            </template>
          </el-table-column> -->
        <!-- <el-table-column align="center" fixed="right" prop="Row_Status" label="操作">
          <template v-slot="{row,$index}">
            <el-button size="small" :disabled="loading" type="danger" @click="handleRemove($index)">删除</el-button>
          </template>
        </el-table-column> -->
      </el-table>
      <el-dialog title="完善信息" :visible.sync="dialogFormVisible">
        <el-form :model="tc">
          <el-form-item label="对账单名称" :label-width="formLabelWidth">
            <el-input v-model="tc.name" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="联系人" :label-width="formLabelWidth">
            <el-input v-model="tc.people" autocomplete="off"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="qd">确 定</el-button>
        </div>
      </el-dialog>
      <el-pagination style="margin-top: 5px" background @size-change="handleSizeChange"
        @current-change="handleCurrentChange" :current-page="form.pageNumber" :page-sizes="[20, 30, 50 ,100 ,300 ,500]"
        :page-size="form.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="tableData.length">
      </el-pagination>
      <div style="height: 100px;"></div>
      <el-form-item class="form-operation">
        <el-button @click="window.history.back()">返回</el-button>
        <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
  <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
  <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
  <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../utils/vue.min.js"></script>
  <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
  <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
  <script type="text/javascript" src="../../../component/component.js"></script>
  <script type="text/javascript" src="../../../utils/FileSaver.min.js"></script>
  <script type="text/javascript" src="../../../utils/FileSaver.js"></script>
  <script type="text/javascript" src="../../../utils/xlsx.full.min.js"></script>
  <script type="text/javascript" src="../../../utils/xlsx.core.min.js"></script>
  <script type="text/javascript" src="../../../config/config.js"></script>
  <script type="text/javascript" src="../../../utils/compressor.js"></script>
  <script type="text/javascript" src="../../../utils/ID_Validity.js"></script>
  <script type="text/javascript" src="../../../utils/utils.js"></script>
  <script type="text/javascript" src="js/add.js"></script>
</body>

</html>